package com.hxd.otc.api;

import com.hxd.otc.base.BaseBean;
import com.hxd.otc.module.my.bean.NoSenseBean;
import com.hxd.otc.module.my.bean.WalletContactsBean;
import com.hxd.otc.module.wallet.bean.CoinOneKeyRateVoBean;
import com.hxd.otc.module.wallet.bean.TransferRecoderBean;
import com.hxd.otc.module.wallet.bean.WalletAccountInfoBean;
import com.hxd.otc.module.wallet.bean.WalletCoinRateVoBean;
import com.hxd.otc.module.wallet.bean.WalletCoinRecordBean;
import com.hxd.otc.module.wallet.bean.WalletCurrencyBean;
import com.hxd.otc.module.wallet.bean.WalletFeeRuleBean;
import com.hxd.otc.module.wallet.bean.WalletOrderInfoBean;

import java.util.ArrayList;
import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Path;
import retrofit2.http.Query;

/**
 * 作  者 :  卫广玉
 * 时  间 :  2018/6/14 11:22
 * 描  述 :  ${TODO}
 */
public interface IWalletApi {

    //otc 账户信息 个人中心c2c资产列表
    @GET("otc/volume/list")
    Observable<BaseBean<List<WalletCurrencyBean>>> getOtcAccountInfo();

    //常规账户
    //
    // 账户信息 个人中心币币资产列表
    @GET("coin/volume/list")
    Observable<BaseBean<List<WalletCurrencyBean>>> getNormalAccountInfo();

    //获取钱包我的资产信息
    @GET("otc/volume/list")
    Observable<BaseBean<WalletAccountInfoBean>> getWalletAccountInfo(@Query("legalTenderType") String legalTenderType);


    //提币接口
    @POST("coin/volume/withdraw")
    Observable<BaseBean> getWithdrawInfo(@Query("symbol") String symbol, @Query("address") String address, @Query("volume") String volume);

    @POST("coin/volume/withdraw/validate")
    Observable<BaseBean> postGooleValidate(@Query("id") String id, @Query("googleCode") String googleCode);

    //获取钱包记录
    @GET("otc/paying/book")
    Observable<BaseBean<WalletCoinRecordBean>> getWalletCoinRecord(@Query("current") long currPage,
                                                                   @Query("size") long pageSize);

    //提币
    @POST("wallet/bringcoin")
    Observable<BaseBean> coinWithdraw(@Body RequestBody body);


    //转账
    @POST("wallet/transfer")
    Observable<BaseBean> coinTransfer(@Body RequestBody body);

    //获取币币交易汇率
    @GET("wallet/coinrate")
    Observable<BaseBean<List<WalletCoinRateVoBean>>> getWalletCoinRate();

    //获取一键换币汇率
    @GET("wallet/coinChangeThanRate")
    Observable<BaseBean<List<CoinOneKeyRateVoBean>>> getCoinChangeThanRate();


    //AEC 转 MSC
    @POST("wallet/aectrunmsc")
    Observable<BaseBean> AECChangeMSC(@Body RequestBody body);

    //一键转币
    @POST("wallet/exchangeCoin")
    Observable<BaseBean> oneCoinTypeChange(@Body RequestBody body);

    //其他币 转 AEC
    @POST("wallet/akeyturnAec")
    Observable<BaseBean> CoinChangeAEC(@Body RequestBody body);


    //查询商家订单信息
    @GET("wallet/orderInfo")
    Observable<BaseBean<WalletOrderInfoBean>> getOrderInfo(
            @Query("orderId") String orderId);//订单id

    //普通用户付款
    @POST("user/pay")
    Observable<BaseBean> remotePayAEC(@Body RequestBody body);

    /**
     * 获取钱包联系人
     */
    @GET("withdraw/address/list/{id}")
    Observable<BaseBean<ArrayList<WalletContactsBean>>> getContactByUserId(@Path("id") String id);

    /**
     * 删除联系人
     *
     * @param id
     */
    @GET("withdraw/address/delete/{id}")
    Observable<BaseBean> deleteContactById(@Path("id") String id);

    //添加联系人
    @POST("withdraw/address/add")
    Observable<BaseBean> addWalletContact(@Query("symbol") String symbol,
                                          @Query("address") String address,
                                          @Query("tag") String tag);

    /**
     * 提币手续费规则信息
     */
    @GET("wallet/bringCoinFeeRule")
    Observable<BaseBean<ArrayList<WalletFeeRuleBean>>> bringCoinFeeRule();

    /**
     * 法币交易
     *
     * @return
     */
    @GET("wallet/taxrate")
    Observable<BaseBean<List<WalletCoinRateVoBean>>> legalTendeDeal();

    /**
     * 币币账户转入到C2C账户
     *
     * @return
     */
    @POST("offline/volume/inOut")
    Observable<BaseBean> normalToOtcAccount(
            @Query("symbol") String symbol,
            @Query("volume") String volume,
            @Query("from") String from,
            @Query("to") String to);

    /**
     * 获取充币地址
     */
    @GET("coin/user/address/{id}")
    Observable<BaseBean> getRechargeCoinAddress(@Path("id") String id);

    /**
     * 某个币的提币地址列表
     */
    @POST("coin/withdraw/address/list/{id}")
    Observable<BaseBean> getContactAddressList(@Path("id") String id);

    /**
     * 某个币的提币地址列表
     */
    @GET("nosense/order/list")
    Observable<BaseBean<NoSenseBean>> getNoSenseData(@Query("createTime") String createTime, @Query("symbol") String symbol,
                                                     @Query("publishSource") String publishSource);

    @GET("transfer/list")
    Observable<BaseBean<TransferRecoderBean>> getTransferRecoder(@Query("current") long currPage,
                                                                 @Query("size") long pageSize);


    @GET("transfer/getAssetBySymbol")
    Observable<BaseBean> getAssetBySymbol(@Query("symbol") String symbol);


}
